home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / BSP Tree 1.2 / Sources / Graphics / include / polyptr_3d.h < prev    next >
Encoding:
Text File  |  1995-11-17  |  2.6 KB  |  51 lines  |  [TEXT/MMCC]

  1. //------------------------------------------------------------------------------
  2. //    File:                    polyptr.h
  3. //    Date:                    9/24/94
  4. //    Author:                Bretton Wade
  5. //
  6. //    Description:    this file contains the class definition for a reference
  7. //                                counted polygon pointer.
  8. //
  9. //------------------------------------------------------------------------------
  10.  
  11. #include "rcpolygon_3d.h"
  12.  
  13. #ifndef    POLYPTR
  14. #define    POLYPTR
  15.  
  16. //------------------------------------------------------------------------------
  17. //    classes
  18. //------------------------------------------------------------------------------
  19. class    polyptr                                                                                                                                        //    reference counted polygon pointer class
  20. {                                                                                                                                                                //    begin polygon class definition
  21.     private:                                                                                                                                            //    members internal to this class only
  22.     protected:                                                                                                                                        //    members internal to this class hierarchy
  23.                 rcpolygon    *ptr;                                                                                                                    //    the pointer to the reference counted polygon
  24.     public:                                                                                                                                                //    members available externally
  25.                 polyptr (void);                                                                                                                    //    normal constructor
  26.                 polyptr (point_3d *buffer, int count, ...);                                                            //    normal constructor
  27.                 polyptr (rcpolygon *ptr);                                                                                                //    normal constructor
  28.                 polyptr (polyptr &ptr);                                                                                                    //    copy constructor
  29.                 ~polyptr (void);                                                                                                                //    destructor
  30.                 rcpolygon    *operator -> (void) const;                                                                        //    pointer dereference operator
  31.                 rcpolygon    *operator () (void) const;                                                                        //    function call operator
  32.                 polyptr        &operator = (rcpolygon *ptr);                                                                    //    assignment operator
  33.                 polyptr        &operator = (const polyptr &ptr);                                                            //    assignment operator
  34. };                                                                                                                                                            //    end polygon class definition
  35.  
  36. //------------------------------------------------------------------------------
  37. //    inlines
  38. //------------------------------------------------------------------------------
  39. inline    rcpolygon    *polyptr::operator -> (void) const                                                        //    pointer dereference operator
  40. {                                                                                                                                                                //    begin
  41.     return ptr;                                                                                                                                        //    return the pointer value
  42. }                                                                                                                                                                //    end
  43.  
  44. inline    rcpolygon    *polyptr::operator () (void) const                                                        //    function call operator
  45. {                                                                                                                                                                //    begin
  46.     return ptr;                                                                                                                                        //    return the pointer value
  47. }                                                                                                                                                                //    end
  48.  
  49. //------------------------------------------------------------------------------
  50.  
  51. #endif    //POLYPTR